<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-CPP: TCandidates类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-CPP
   </div>
   <div id="projectbrief">AWTK CPP API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="class_t_candidates-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">TCandidates类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a>&gt;</code></p>
<div class="dynheader">
类 TCandidates 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_t_candidates.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a10001845b27fac01aafba77533c51ace"><td class="memItemLeft" align="right" valign="top"><a id="a10001845b27fac01aafba77533c51ace"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TCandidates</b> (widget_t *nativeObj)</td></tr>
<tr class="separator:a10001845b27fac01aafba77533c51ace"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa43cf24b6e6ba7b9b7dddddf0034b8fc"><td class="memItemLeft" align="right" valign="top"><a id="aa43cf24b6e6ba7b9b7dddddf0034b8fc"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TCandidates</b> (const candidates_t *nativeObj)</td></tr>
<tr class="separator:aa43cf24b6e6ba7b9b7dddddf0034b8fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7f55972089e6fb99f2907f1949f1b4b"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#ab7f55972089e6fb99f2907f1949f1b4b">SetPre</a> (bool pre)</td></tr>
<tr class="separator:ab7f55972089e6fb99f2907f1949f1b4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2904ab214ded964c59da2f10d4ae4829"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#a2904ab214ded964c59da2f10d4ae4829">SetSelectByNum</a> (bool select_by_num)</td></tr>
<tr class="separator:a2904ab214ded964c59da2f10d4ae4829"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1484f8463098f06d70f16db0538292e3"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#a1484f8463098f06d70f16db0538292e3">SetAutoHide</a> (bool auto_hide)</td></tr>
<tr class="separator:a1484f8463098f06d70f16db0538292e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d32c3c0c104446a302c43bfad0a884d"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#a3d32c3c0c104446a302c43bfad0a884d">SetButtonStyle</a> (const char *button_style)</td></tr>
<tr class="separator:a3d32c3c0c104446a302c43bfad0a884d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa63a979e0e420d0bbe96b7efd361ffdd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#aa63a979e0e420d0bbe96b7efd361ffdd">GetPre</a> () const</td></tr>
<tr class="separator:aa63a979e0e420d0bbe96b7efd361ffdd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addf5d1208bf721756ac769ad6e31cc42"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#addf5d1208bf721756ac769ad6e31cc42">GetSelectByNum</a> () const</td></tr>
<tr class="separator:addf5d1208bf721756ac769ad6e31cc42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5a34d49cc0c54cdf3e4a7e0bdfbc4bb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#aa5a34d49cc0c54cdf3e4a7e0bdfbc4bb">GetAutoHide</a> () const</td></tr>
<tr class="separator:aa5a34d49cc0c54cdf3e4a7e0bdfbc4bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a88c4133e179a12005cad12fdfe6cc5b1"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#a88c4133e179a12005cad12fdfe6cc5b1">GetButtonStyle</a> () const</td></tr>
<tr class="separator:a88c4133e179a12005cad12fdfe6cc5b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff85fff778686694a8055d63fadb3698"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#aff85fff778686694a8055d63fadb3698">GetEnablePreview</a> () const</td></tr>
<tr class="separator:aff85fff778686694a8055d63fadb3698"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a226c09d428594a0db130f87af1e5bff5"><td class="memItemLeft" align="right" valign="top"><a id="a226c09d428594a0db130f87af1e5bff5"></a>
static <a class="el" href="class_t_candidates.html">TCandidates</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (widget_t *nativeObj)</td></tr>
<tr class="separator:a226c09d428594a0db130f87af1e5bff5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a198a149e8d612468c34267c28e85a1b6"><td class="memItemLeft" align="right" valign="top"><a id="a198a149e8d612468c34267c28e85a1b6"></a>
static <a class="el" href="class_t_candidates.html">TCandidates</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (const widget_t *nativeObj)</td></tr>
<tr class="separator:a198a149e8d612468c34267c28e85a1b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cc09988410e73c580583afe0e5bf0e5"><td class="memItemLeft" align="right" valign="top"><a id="a5cc09988410e73c580583afe0e5bf0e5"></a>
static <a class="el" href="class_t_candidates.html">TCandidates</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (TWidget &amp;obj)</td></tr>
<tr class="separator:a5cc09988410e73c580583afe0e5bf0e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7786ada3baff3c0a808d74044a049644"><td class="memItemLeft" align="right" valign="top"><a id="a7786ada3baff3c0a808d74044a049644"></a>
static <a class="el" href="class_t_candidates.html">TCandidates</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (const TWidget &amp;obj)</td></tr>
<tr class="separator:a7786ada3baff3c0a808d74044a049644"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ff7a28817755125118444aad0f9f41c"><td class="memItemLeft" align="right" valign="top">static TWidget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_candidates.html#a3ff7a28817755125118444aad0f9f41c">Create</a> (TWidget &amp;parent, xy_t x, xy_t y, wh_t w, wh_t h)</td></tr>
<tr class="separator:a3ff7a28817755125118444aad0f9f41c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>输入法候选字词控件。</p>
<p>如果希望启用用数字选择对应的候选字，请设置属性grab_keys="true"。如：</p>
<div class="fragment"><div class="line">*&lt;<span class="keywordtype">candidates</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;0&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;0&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;100%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;30&quot;</span> <span class="keyword">grab_keys</span>=<span class="stringliteral">&quot;true&quot;</span>/&gt;</div>
</div><!-- fragment --><p>&gt;相关文件： assets/default/raw/ui/kb_default.xml</p>
<p>如果希望通过左右键切换不同的候选字，除了设置属性grab_keys="true"，还需要设置按钮的focused状态的style。</p>
<div class="fragment"><div class="line">*&lt;<span class="keywordtype">style</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;candidates&quot;</span> <span class="keyword">text_color</span>=<span class="stringliteral">&quot;black&quot;</span>&gt;</div>
<div class="line">*&lt;<span class="keywordtype">normal</span>  /&gt;</div>
<div class="line">*&lt;<span class="keywordtype">pressed</span>    <span class="keyword">bg_color</span>=<span class="stringliteral">&quot;#c0c0c0&quot;</span> <span class="keyword">border_color</span>=<span class="stringliteral">&quot;#a0a0a0&quot;</span>/&gt;</div>
<div class="line">*&lt;<span class="keywordtype">over</span>       <span class="keyword">bg_color</span>=<span class="stringliteral">&quot;#e0e0e0&quot;</span> <span class="keyword">border_color</span>=<span class="stringliteral">&quot;#a0a0a0&quot;</span>/&gt;</div>
<div class="line">*&lt;<span class="keywordtype">focused</span>    <span class="keyword">border_color</span>=<span class="stringliteral">&quot;#a0a0a0&quot;</span>/&gt;</div>
<div class="line">*&lt;/<span class="keywordtype">style</span>&gt;</div>
</div><!-- fragment --><p>&gt;相关文件：assets/default/raw/styles/keyboard.xml </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a3ff7a28817755125118444aad0f9f41c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3ff7a28817755125118444aad0f9f41c">&#9670;&nbsp;</a></span>Create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">TWidget TCandidates::Create </td>
          <td>(</td>
          <td class="paramtype">TWidget &amp;&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xy_t&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xy_t&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wh_t&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wh_t&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建candidates对象</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

</div>
</div>
<a id="aa5a34d49cc0c54cdf3e4a7e0bdfbc4bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5a34d49cc0c54cdf3e4a7e0bdfbc4bb">&#9670;&nbsp;</a></span>GetAutoHide()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool TCandidates::GetAutoHide </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>没有候选字时，是否自动隐藏控件。 </p>

</div>
</div>
<a id="a88c4133e179a12005cad12fdfe6cc5b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88c4133e179a12005cad12fdfe6cc5b1">&#9670;&nbsp;</a></span>GetButtonStyle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char * TCandidates::GetButtonStyle </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>按钮的style名称。 </p>

</div>
</div>
<a id="aff85fff778686694a8055d63fadb3698"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff85fff778686694a8055d63fadb3698">&#9670;&nbsp;</a></span>GetEnablePreview()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool TCandidates::GetEnablePreview </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>是否启用候选字预览。 </p>

</div>
</div>
<a id="aa63a979e0e420d0bbe96b7efd361ffdd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa63a979e0e420d0bbe96b7efd361ffdd">&#9670;&nbsp;</a></span>GetPre()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool TCandidates::GetPre </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>是否为预候选字。</p>
<blockquote class="doxtable">
<p>预候选字: 在有的输入法中，比如T9硬键盘输入时，按下12两个键时，预候选字会显示可用的拼音列表。 从预候选字列表中选择拼音，再查询拼音对应的候选字列表。 </p>
</blockquote>

</div>
</div>
<a id="addf5d1208bf721756ac769ad6e31cc42"></a>
<h2 class="memtitle"><span class="permalink"><a href="#addf5d1208bf721756ac769ad6e31cc42">&#9670;&nbsp;</a></span>GetSelectByNum()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool TCandidates::GetSelectByNum </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>是否启用用数字选择候选字。比如按下1选择第1个候选字，按下2选择第2个候选字。 </p>

</div>
</div>
<a id="a1484f8463098f06d70f16db0538292e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1484f8463098f06d70f16db0538292e3">&#9670;&nbsp;</a></span>SetAutoHide()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TCandidates::SetAutoHide </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>auto_hide</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置是否自动隐藏。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">auto_hide</td><td>是否自动隐藏。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a3d32c3c0c104446a302c43bfad0a884d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d32c3c0c104446a302c43bfad0a884d">&#9670;&nbsp;</a></span>SetButtonStyle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TCandidates::SetButtonStyle </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>button_style</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置按钮的style名称。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">button_style</td><td>按钮的style名称。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="ab7f55972089e6fb99f2907f1949f1b4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab7f55972089e6fb99f2907f1949f1b4b">&#9670;&nbsp;</a></span>SetPre()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TCandidates::SetPre </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>pre</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置是否为预候选字列表。</p>
<blockquote class="doxtable">
<p>为预候选字列表则注册EVT_IM_SHOW_PRE_CANDIDATES，否则注册EVT_IM_SHOW_CANDIDATES事件。 </p>
</blockquote>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">pre</td><td>是否为预候选字列表。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a2904ab214ded964c59da2f10d4ae4829"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2904ab214ded964c59da2f10d4ae4829">&#9670;&nbsp;</a></span>SetSelectByNum()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TCandidates::SetSelectByNum </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>select_by_num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置是否启用用数字选择候选字。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">select_by_num</td><td>是否启用用数字选择候选字。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a></li>
<li>output/awtk_cpp.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
